function W = welfare_corner_targeted_subsidies(mu,B,A,P,rho,lambda_rnd,lambda_tech,s)

%% Compute output (lower level of the bilevel optimization problem).
q = output_corner(mu,B,A,P,rho,lambda_rnd,lambda_tech,s);

%% Compute welfare (upper level objective function of the bilevel optimization problem).
W = mu'*q - q'*(rho/2*B - lambda_rnd*A - lambda_tech*P)*q + q'*(lambda_rnd*A + lambda_tech*P)*s - 1/2*s'*s;
